package 赛码;

import java.util.Scanner;

public class 序列号 {
    public static void main(String[] args){
        Scanner scanner = new Scanner(System.in);
        String a = scanner.next();
        System.out.println(function(a));
    }
    public static String function(String s){
        if (s.length()!=16)return "error";
        int q=0,o=0;
        for (int a=1;a<s.length();a+=2){
            try {
                Integer.parseInt(s.substring(a,a+1));
            }catch (Exception e){
                return "error";
            }
            q = q+Integer.parseInt(s.substring(a,a+1));
        }
        for (int a=0;a<s.length();a+=2){
            try {
                Integer.parseInt(s.substring(a,a+1));
            }catch (Exception e){
                return "error";
            }
            if (Integer.parseInt(s.substring(a,a+1))<5) o = o + 2*Integer.parseInt(s.substring(a,a+1));
            else o = o + (2*Integer.parseInt(s.substring(a,a+1))-9);
        }

        if ((q+o)%10==0)return "ok";
    return  "error";
    }
}
